/**
 * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
 * following conditions are met:
 * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
 * disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
 * following disclaimer in the documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
 * products derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * @file      main.h
 * @author    MCU Driver Team
 * @brief     This file contains driver init functions.
 */

/* Define to prevent recursive inclusion ------------------------------------- */
#ifndef MCU_MAGIC_TAG_SYSTEM_INIT_H
#define MCU_MAGIC_TAG_SYSTEM_INIT_H

#include "uart.h"
#include "uart_ex.h"
#include "i2c.h"
#include "i2c_ex.h"
#include "crg.h"
#include "dma.h"
#include "dma_ex.h"
#include "iocmg.h"

#define IO_SPEED_FAST 0x00U
#define IO_SPEED_SLOW 0x01U

#define IO_DRV_LEVEL4 0x00U
#define IO_DRV_LEVEL3 0x01U
#define IO_DRV_LEVEL2 0x02U
#define IO_DRV_LEVEL1 0x03U

#define XTAL_DRV_LEVEL4 0x03U
#define XTAL_DRV_LEVEL3 0x02U
#define XTAL_DRV_LEVEL2 0x01U
#define XTAL_DRV_LEVEL1 0x00U

extern UART_Handle g_uart0;
extern I2C_Handle g_i2c0_master;

extern DMA_Handle g_dmac;

BASE_StatusType CRG_Config(CRG_CoreClkSelect *coreClkSelect);
void SystemInit(void);

void common_i2c0_tx_callback(I2C_Handle *handle);
void common_i2c0_rx_callback(I2C_Handle *handle);
void common_i2c0_error_callback(I2C_Handle *handle);

/* USER CODE BEGIN 0 */
/* USER CODE 区域内代码不会被覆盖，区域外会被生成的默认代码覆盖（其余USER CODE 区域同理） */
/* USER CODE END 0 */

#endif /* MCU_MAGIC_TAG_SYSTEM_INIT_H */